package com.yuand.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yuand.entity.SysDictData;
import com.yuand.mapper.SysDictDataMapper;
import com.yuand.service.SysDictDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 字典数据表 服务实现类
 * </p>
 *
 * @author yuandong
 * @since 2022-02-11
 */
@Service
public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements SysDictDataService {

    @Autowired
    private SysDictDataMapper sysDictDataMapper;


    /**
     * 查询字典数据列表
     *
     * @param sysDictData
     * @return
     */
    public List<SysDictData> selectDictDataList(SysDictData sysDictData) {
        return this.sysDictDataMapper.selectDictDataList(sysDictData);
    }

    /**
     * 根据字典type查询字典数据
     *
     * @param dictType
     * @return
     */
    public List<SysDictData> selectDictDataByType(String dictType) {
        return this.sysDictDataMapper.selectList(new QueryWrapper<SysDictData>().eq("dict_type", dictType));
    }

}
